function utils#set_tcd(project_file_path)
   execute ":tcd ".utils#gettcd(a:project_file_path) 
endfunction

let s:rootpath=expand("/")
let s:homepath=expand("~")
function utils#gettcd(project_file_path)
    let l:dir=expand(a:project_file_path)
    if isdirectory(l:dir)
    else 
        let l:dir=fnamemodify(l:dir,':p:h')
    endif
    let l:result=l:dir
    let i=0
    while l:dir != s:rootpath && l:dir!=s:homepath && i<=20
        let i+=1
        echo l:dir
        if glob(l:dir.'/.git') != ""
            let l:result=l:dir
            echo 'tcd: ' .l:result
            break
        else
            let l:dir=expand(fnamemodify(l:dir,':h'))
        endif
    endwhile
    return l:result
endfunction

function utils#mapping_config(mapping_path)
    execute('py3 '.'vim_mapping_custom.import_mapping_file("' .a:mapping_path.'")') 
endfunction

function utils#function_config(function_path)
    execute('py3 '.'vim_mapping_custom.import_function("' .a:function_path.'")') 
endfunction

function utils#get_mapping_result()
    execute('tabnew '. g:python_mapping_result_file)
endfunction

function utils#tab_open_file(path)
    execute('py3 open_file_in_tabpage("'.a:path .'")' )
endfunction

